<template>
  <div class="bordercontents5" :ref="ref">
    <svg class="dv-border-svg-container" :width="width" :height="height">
      <defs>
        <filter id="filterId" height="150%" width="150%" x="-25%" y="-25%">
          <feMorphology
            operator="dilate"
            radius="2"
            in="SourceAlpha"
            result="thicken"
          />
          <feGaussianBlur in="thicken" stdDeviation="3" result="blurred" />
          <feFlood flood-color="#2feefb" result="glowColor" />
          <feComposite
            in="glowColor"
            in2="blurred"
            operator="in"
            result="softGlowColored"
          />
          <feMerge>
            <feMergeNode in="softGlowColored" />
            <feMergeNode in="SourceGraphic" />
          </feMerge>
        </filter>
      </defs>

      <!-- 内容 -->
      <polyline
        :class="['', transfroms ? 'dot' : '']"
        :points="`2,10 10,2 ${width - 10},2 ${width - 2},10 ${width - 2},${
          height - 10
        } ${width - 2},${height - 10} ${width - 10},${height - 2} 10,${
          height - 2
        } 2 ,${height - 10} 2,10`"
        style="fill: #25415c"
      />
      <!-- 下 -->
      <polyline
        :class="['dv-bb7-line-width-3', transfroms ? 'dot' : '']"
        :points="`${width - 2},${height - 10} ${width - 10},${height - 2} 10,${
          height - 2
        } 2 ,${height - 10} 2,${height - 10}`"
      />
      <!-- 上 -->
      <polyline
        :class="['dv-bb7-line-width-3', transfroms ? 'dot' : '']"
        :points="`2,10 10,2 ${width - 10},2 ${width - 2},10 ${width - 2},10 ${
          width - 2
        },10`"
      />

      <polygon
        class="dv-bb7-line-width-5"
        :points="`
          3, 35 6, 40
          6,${height - 40} 3, ${height - 35}
        `"
        style="fill: #25415c"
      />

      <polygon
        class="dv-bb7-line-width-5"
        :points="`
          ${width - 3}, 35 ${width - 6}, 40
          ${width - 6}, ${height - 40} ${width - 3}, ${height - 35}
        `"
        style="fill: #25415c"
      />
    </svg>
    <div class="echartCon">
      <div>
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
import autoMinix from "../autoResize";
import { defineComponent } from "vue-demi";
export default defineComponent({
  name: "VDorderLine5",
  mixins: [autoMinix],
  props: {
    transfroms: {
      type: Boolean,
      default: () => false,
    },
    filter: {
      type: Boolean,
      default: () => true,
    },
  },
  data(){
     return {
       ref:'VDorderLine5',
     }
  }, 
  setup() {
    let ref = "vborder5";
    return {
      ref,
    };
  },
});
</script>

<style lang="less" scoped>
.dv-border-svg-container > polyline {
  fill: none;
  stroke-linecap: round;
}
.dv-bb7-line-width-2 {
  stroke-width: 2;
  stroke: #6fd1d8;
}
.dv-bb7-line-width-3 {
  stroke-width: 2;
  stroke: #2feefb;
}
.dv-bb7-line-width-4 {
  stroke-width: 3;
  stroke: #033c86;
}
.dv-bb7-line-width-5 {
  stroke-width: 1;
  stroke: #2feefb;
}
.bordercontents5 {
  position: relative;
  width: 100%;
  height: 100%;
}
.dv-border-svg-container {
  position: absolute;
  top: 0;
  left: 0;
}
.echartCon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  & > div {
    border-radius: 15px;
  }
}
.echartCon > div {
  width: 100%;
  height: 100%;
}
.dot {
  stroke-dashoffset: 100;
  stroke-dasharray: 300;
  animation: dots 5s linear infinite;
}
@keyframes dots {
  0% {
    stroke-dashoffset: 300;
  }
  100% {
    stroke-dashoffset: 1500;
  }
}
</style>